import { createRouter, createWebHashHistory } from 'vue-router'
import login from '@/views/login.vue'
import layout from '@/views/Layout/layout.vue'
import category from '@/views/category.vue'
import home from '@/views/Home/home.vue'
const routes = [
  {
    path: '/',
    name: 'layout',
    component: layout,
    children: [
      // 默认路由
      {
        path: '',
        name: 'home',
        component: home
      },
      {
        path: '/category',
        name: 'category',
        component: category
      }
    ]
  },
  {
    path: '/login',
    name: 'login',
    component: login
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
